//
//  P3654firststep.cpp
//  Algorithm
//
//  Created by 刘锦程 on 2023/9/10.
//
#include<cmath>
#include <stdio.h>
#include<iostream>
using namespace std;
int R,C;
char inp[101][101];
int book[101][101];

int ans;
int dir[4][2]={{1,0},{-1,0},{0,-1},{0,1}};
int K;
int P3654ans(){
    cin>>R>>C>>K;
    for(int i=0;i<R;i++){
        for(int j=0;j<C;j++){
            cin>>inp[i][j];
            if(inp[i][j]=='#') book[i][j]=1;

        }
    }
    if(K==1){
        for(int i=0;i<R;i++){
            for(int j=0;j<C;j++){
                if(inp[i][j]=='.') ans++;
            }
        }
        cout<<ans<<endl;
        return 0;
    }
    for(int i=0;i<R;i++){
        for(int j=0;j<C;j++){
            if(!book[i][j]){
                int k0=1,k1=1;
                int x0=i+1,y0=j,y1=j+1,x1=i;
                while(k0<K&&!book[x0][y0]&&x0<R&&y0<C){
                    x0++;
                    k0++;
                }
                if(k0==K) ans++;
                while(k1<K&&!book[x1][y1]&&x1<R&&y1<C){
                    y1++;
                    k1++;
                }
                if(k1==K) ans++;
                book[i][j]=1;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}
//5 5 2
//.###.
//##.#.
//..#..
//#..#.
//#.###
